/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// ILoginLog interface for NHibernate mapped table 'LoginLog'.
	/// </summary>
	public interface ILoginLog
	{
		#region Public Properties
		
		int ll_id
		{
			get ;
			set ;
			  
		}
		
		int ll_uid
		{
			get ;
			set ;
			  
		}
		
		string ll_ip
		{
			get ;
			set ;
			  
		}
		
		DateTime ll_date
		{
			get ;
			set ;
			  
		}
		
		int ll_type
		{
			get ;
			set ;
			  
		}
		
		string ll_remark
		{
			get ;
			set ;
			  
		}
		
		int ll_from
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// LoginLog object for NHibernate mapped table 'LoginLog'.
	/// </summary>
	[Serializable]
	public class LoginLog : ICloneable,ILoginLog
	{
		#region Member Variables

		protected int _ll_id;
		protected int _ll_uid;
		protected string _ll_ip;
		protected DateTime _ll_date;
		protected int _ll_type;
		protected string _ll_remark;
		protected int _ll_from;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public LoginLog() {}
		
		public LoginLog(int plluid, string pllip, DateTime plldate, int plltype, string pllremark, int pllfrom)
		{
			this._ll_uid = plluid; 
			this._ll_ip = pllip; 
			this._ll_date = plldate; 
			this._ll_type = plltype; 
			this._ll_remark = pllremark; 
			this._ll_from = pllfrom; 
		}
		
		public LoginLog(int plluid, DateTime plldate, int plltype, int pllfrom)
		{
			this._ll_uid = plluid; 
			this._ll_date = plldate; 
			this._ll_type = plltype; 
			this._ll_from = pllfrom; 
		}
		
		public LoginLog(int pllid)
		{
			this._ll_id = pllid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int ll_id
		{
			get { return _ll_id; }
			set { _bIsChanged |= (_ll_id != value); _ll_id = value; }
			
		}
		
		public virtual int ll_uid
		{
			get { return _ll_uid; }
			set { _bIsChanged |= (_ll_uid != value); _ll_uid = value; }
			
		}
		
		public virtual string ll_ip
		{
			get { return _ll_ip; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("ll_ip", "ll_ip value, cannot contain more than 20 characters");
			  _bIsChanged |= (_ll_ip != value); 
			  _ll_ip = value; 
			}
			
		}
		
		public virtual DateTime ll_date
		{
			get { return _ll_date; }
			set { _bIsChanged |= (_ll_date != value); _ll_date = value; }
			
		}
		
		public virtual int ll_type
		{
			get { return _ll_type; }
			set { _bIsChanged |= (_ll_type != value); _ll_type = value; }
			
		}
		
		public virtual string ll_remark
		{
			get { return _ll_remark; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("ll_remark", "ll_remark value, cannot contain more than 200 characters");
			  _bIsChanged |= (_ll_remark != value); 
			  _ll_remark = value; 
			}
			
		}
		
		public virtual int ll_from
		{
			get { return _ll_from; }
			set { _bIsChanged |= (_ll_from != value); _ll_from = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			LoginLog castObj = null;
			try
			{
				castObj = (LoginLog)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._ll_id == castObj.ll_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _ll_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for LoginLog 

	
	public interface ILoginLogCollection : ICollection
	{
		LoginLog this[int index]{	get; set; }
		void Add(LoginLog pLoginLog);
		void Clear();
	}
	
	[Serializable]
	public class LoginLogCollection : ILoginLogCollection
	{
		private IList<LoginLog> _arrayInternal;

		public LoginLogCollection()
		{
			_arrayInternal = new List<LoginLog>();
		}
		
		public LoginLogCollection( IList<LoginLog> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<LoginLog>();
			}
		}

		public LoginLog this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((LoginLog[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(LoginLog pLoginLog) { _arrayInternal.Add(pLoginLog); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<LoginLog> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
